home *** CD-ROM | disk | FTP | other *** search
- Path: news.iadfw.net!usenet
- From: alpet@airmail.net (Adam Peterson)
- Newsgroups: comp.lang.c
- Subject: Re: Do you have ever pass structures?
- Date: Thu, 22 Feb 1996 06:45:11 GMT
- Organization: customer of Internet America
- Message-ID: <4ggsio$343@news-f.iadfw.net>
- References: <4ge8mi$qjm@srvr1.engin.umich.edu>
- NNTP-Posting-Host: dal24-16.ppp.iadfw.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- >So is there any REAL advantage is passing an entire structure? Do people
- >ever do it? I've some people's source code and almost always, they
- >pass pointers to structures instead of the structure itself. In a way,
- >passing a pointer to an array instead of the array itself might be
- >feature not a bug in C. :)
-
- The *disadvantage* is speed and space. Passing a pointer is just
- word//double word. Passing the actual structure requires loading the
- stack with all the elements of the structure...slow...
-
- Adam
-
-
-